package com.team.union.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.baomidou.mybatisplus.plugins.Page;
import com.team.union.entity.User;
import com.team.union.service.UserService;
import com.team.union.sql.result.UserResult;
import com.xiaoleilu.hutool.lang.Console;

/**
 * <p>
 * 前端控制器
 * </p>
 *
 * @author SiZhongxia
 * @since 2018-07-15
 */
@RestController
@RequestMapping("user")
public class UserController {

	@Autowired
	private UserService userService;

	@GetMapping("index")
	public String index() {

		User user2 = userService.selectById(1018478307307458561L);
		System.out.println(user2);
		User user3 = userService.selectById(1018478307307458561L);
		System.out.println(user3);

		Page<UserResult> page = new Page<>(1, 2);
		page.setSearchCount(true);
		userService.selectUserList(page);
		if (page != null) {
			Console.log(page);
			Console.log(page.getRecords());
		}
		return "hello";
	}

}
